function loginService($http) {
    function login(username, password,callback) {
        var manager = {
            uname: username,
            password: password
        };
    var postData={manager:manager};
    var config={};
        $http.post("/o2o/admin/manager/", postData, config)
            .then(function (res) {
                console.log(res);
                callback(null, res.data);
            })
            .catch(function(err) {
                console.error(err);
                callback(err, null);
            })
    }
    return {
       login:login
    }
}
module.exports = loginService;